
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>ZMS（中麦后台管理系统）</title>

    <!-- Bootstrap core CSS -->
    <link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/dashboard.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <!-- javascript template engine. -->
    <script src="js/mustache.min.js"></script>
    <script>
    	var _loginInfo = {};
    </script>
  </head>

  <body>
	<!-- 顶部导航菜单 S -->
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <a class="navbar-brand" href="#">ZMCMS（中麦后台管理系统）</a>
        </div>
        
        <div id="navbar" class="navbar-collapse collapse">    
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">首页</a></li>
            <li><a href="#about">用户管理</a></li>
            <li><a href="#contact">广告管理</a></li>
            <li><a href="#contact">系统管理</a></li>
            <li><a href="#contact">页面管理</a></li>
            <li><a href="#contact">商品管理</a></li>
            <li><a href="#contact">缓存管理</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li role="separator" class="divider"></li>
                <li class="dropdown-header">Nav header</li>
                <li><a href="#">Separated link</a></li>
                <li><a href="#">One more separated link</a></li>
              </ul>
            </li>
          </ul>
        
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#"> kaliang.li</a></li>
            <li><a href="#">exit</a></li>
          </ul>
          
        </div>
      </div>
    </nav>
	<!-- 顶部导航菜单 E -->
	
    <div class="container-fluid">
      <div class="row">
      	<!-- 功能菜单 S -->
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li class="active" data="102"><a href="#">Overview <span class="sr-only">(current)</span></a></li>
            <li><a href="#" id="reports">Reports</a></li>
            <li><a href="#" id="category">Analytics</a></li>
            <li><a href="#">Export</a></li>
            <li><a href="#">Nav item</a></li>
            <li><a href="#">Nav item again</a></li>
            <li><a href="#">One more nav</a></li>
            <li><a href="#">Another nav item</a></li>
            <li><a href="#">More navigation</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="#">Nav item again</a></li>
            <li><a href="#">One more nav</a></li>
            <li><a href="#">Another nav item</a></li>
          </ul>
        </div>
        <!-- 功能菜单 E -->
        
 		<!-- 主内容区域 S -->
 		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" id="mainBoard">
		<!-- 导航路径 S -->
		<ol class="breadcrumb">
		  <li><a href="#">Home</a></li>
		  <li class="active">welcome</li>
		</ol>
		<!-- 导航路径 E -->
		
		<!-- 标题区 S -->
		<h1 class="page-header">Dashboard</h1>
		<div class="row placeholders">
		</div>
	
		<h2 class="sub-header">Section title</h2>
		<!-- 标题区 E -->
		
		<!-- 内容区 S -->
		
		<!-- 内容区 E -->
 		<!-- 主内容区域 E -->
        </div>
      </div>
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

	<!-- 每个页面都要加载校验登陆状态
	<script src="js/loginChecker.js"></script>-->
	
	<script> 
		$('#reports').on('click',function(){
			$.get('template.mst', function(template) {	
			    $.ajax({
				 type: "get",
				 async: false,
				 url: "http://localhost:8080/category/list.do",
				 dataType: "json",
				 success: function(data){
					data.forEach(function(e){
						//var template = $('#categoryTpl').html();
						Mustache.parse(template);
						var rendered = Mustache.render(template,e);
						$("#categoryTable>tbody").append(rendered);
					});
				 },
				 error: function(){
					 alert('fail');
				 }
			    });
			});
		});
		
		$('#category').on('click',function(){
			$.get('jstemplate/categoryList.mst', function(template) {
				$("#mainBoard").remove();	
			    $(".row").append(template);
			});
		});
	</script>
	
	<script type="text/html" id="categoryTpl">			
		<tr>
	      <td>{{id}}</td>
	      <td>Lorem</td>
	      <td>{{name}}</td>
	      <td>dolor</td>
	      <td>sit</td>
	    </tr>
	</script>
  </body>
</html>
